<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Date Parameter</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Date Parameter
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jul 25, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <h3><a name="DateParameter-DateParameter"></a>Date Parameter</h3>

<p>This will prompt the user to enter a date value when a force build is requested.</p>

<p>This parameter can then be used by a dynamic value in a task.</p>

<h3><a name="DateParameter-Version"></a>Version</h3>

<p>This parameter is available from version 1.5.0.</p>

<h3><a name="DateParameter-Examples"></a>Examples</h3>

<p>Minimal example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;dateParameter&gt;</span>
  <span class="code-tag">&lt;name&gt;</span>CutOffDate<span class="code-tag">&lt;/name&gt;</span>
<span class="code-tag">&lt;/dateParameter&gt;</span></pre>
</div></div>

<p>Full example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;dateParameter&gt;</span>
  <span class="code-tag">&lt;name&gt;</span>CutOffDate<span class="code-tag">&lt;/name&gt;</span>
  <span class="code-tag">&lt;display&gt;</span>Cut Off Date<span class="code-tag">&lt;/display&gt;</span>
  <span class="code-tag">&lt;description&gt;</span>What is the cut-off date for changes?<span class="code-tag">&lt;/description&gt;</span>
  <span class="code-tag">&lt;default&gt;</span>today<span class="code-tag">&lt;/default&gt;</span>
  <span class="code-tag">&lt;minimum&gt;</span>1-Jan-2000<span class="code-tag">&lt;/minimum&gt;</span>
  <span class="code-tag">&lt;maximum&gt;</span>31-Dec-2100<span class="code-tag">&lt;/maximum&gt;</span>
  <span class="code-tag">&lt;required&gt;</span>false<span class="code-tag">&lt;/required&gt;</span>
<span class="code-tag">&lt;/dateParameter&gt;</span></pre>
</div></div>

<p>Example in context:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
  <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/sourcecontrol&gt;</span>
  <span class="code-tag">&lt;triggers&gt;</span>
    <span class="code-tag">&lt;intervalTrigger /&gt;</span>
  <span class="code-tag">&lt;/triggers&gt;</span>
  <span class="code-tag">&lt;tasks&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/tasks&gt;</span>
  <span class="code-tag">&lt;publishers&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/publishers&gt;</span>
  <span class="code-tag">&lt;parameters&gt;</span>
    <span class="code-tag">&lt;dateParameter&gt;</span>
      <span class="code-tag">&lt;name&gt;</span>CutOffDate<span class="code-tag">&lt;/name&gt;</span>
      <span class="code-tag">&lt;display&gt;</span>Cut Off Date<span class="code-tag">&lt;/display&gt;</span>
      <span class="code-tag">&lt;description&gt;</span>What is the cut-off date for changes?<span class="code-tag">&lt;/description&gt;</span>
      <span class="code-tag">&lt;default&gt;</span>today<span class="code-tag">&lt;/default&gt;</span>
      <span class="code-tag">&lt;minimum&gt;</span>1-Jan-2000<span class="code-tag">&lt;/minimum&gt;</span>
      <span class="code-tag">&lt;maximum&gt;</span>31-Dec-2100<span class="code-tag">&lt;/maximum&gt;</span>
      <span class="code-tag">&lt;required&gt;</span>false<span class="code-tag">&lt;/required&gt;</span>
    <span class="code-tag">&lt;/dateParameter&gt;</span>
  <span class="code-tag">&lt;/parameters&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

<h3><a name="DateParameter-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> name </td>
<td class='confluenceTd'> The name of the parameter. This is the name that will be used internally by CruiseControl.NET. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>n/a</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> display </td>
<td class='confluenceTd'> The display label for the parameter. If set, this is what the user will see. If it is not set, then the name will be used for the label. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>none</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> description </td>
<td class='confluenceTd'> A description to display to the user. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>none</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> default </td>
<td class='confluenceTd'> The default value to use if the user does not enter a value for this parameter. </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> minimum </td>
<td class='confluenceTd'> The minimum allowed date. </td>
<td class='confluenceTd'> Date </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> 1-Jan-0000 </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> maximum </td>
<td class='confluenceTd'> The maximum allowed date. </td>
<td class='confluenceTd'> Date </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> 31-Dec-9999 </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> required </td>
<td class='confluenceTd'> Whether the parameter is required or not. </td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> False </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

<h3><a name="DateParameter-DefaultValues"></a>Default Values</h3>

<p>The following special values are allowed for the default value:</p>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Value </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Example </th>
</tr>
<tr>
<td class='confluenceTd'> today </td>
<td class='confluenceTd'> Today's date </td>
<td class='confluenceTd'> today </td>
</tr>
<tr>
<td class='confluenceTd'> dayofmonth </td>
<td class='confluenceTd'> The day of the month. This must be followed by a number in brackets for the day. </td>
<td class='confluenceTd'> dayofmonth(15) </td>
</tr>
<tr>
<td class='confluenceTd'> dayofweek </td>
<td class='confluenceTd'> The day of the week, where 0 is Sunday through to 6 is Saturday. This must be followed by a number in brackets for the day. </td>
<td class='confluenceTd'> dayofweek(3) </td>
</tr>
</tbody></table>

<p>Additionally, it is possible to add or subtract days from one of the special values. E.g. today-3 would be the date three days ago.</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>